﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="a_products.ascx.cs" Inherits="administrator_uc_admin_a_products" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<script src="../js/jquery-1.5.2.min.js" type="text/javascript"></script>
<script src="../js/jquery.MultiFile.js" type="text/javascript"></script>
<script type="text/javascript">
    /* Optional: Temporarily hide the "tabber" class so it does not "flash"
    on the page as plain HTML. After tabber runs, the class is changed
    to "tabberlive" and it will appear. */
    //document.write('<style type="text/css">.tabber{display:none;}<\/style>');
    function checkUncheckSPKhuyenMai() {
        var checkbox1 = $("#<%= chkSPKhuyenMai.ClientID %>");
        var domCheckbox1 = checkbox1[0];
        var isChecked = domCheckbox1.checked;
        if (isChecked) {
            $("#<%= txtKhuyenMaiInfo.ClientID %>").removeAttr("disabled");
            var mytext = document.getElementById("<%= txtKhuyenMaiInfo.ClientID %>");
            mytext.focus();
        }
        else {
            $("#<%= txtKhuyenMaiInfo.ClientID %>").attr("disabled", "disabled");
        }
    }
</script>
<script>
    $(document).ready(function () {
        $("#<%= txtKhuyenMaiInfo.ClientID %>").attr("disabled", "disabled");
    });    
</script>
<%--<div class="classtitle">THÊM MỚI</div>--%>
<div class="classmessage">  
    <asp:Label ID="lblMessage" runat="server"></asp:Label>  
</div> 
<asp:UpdatePanel ID="upPanelAdmin" runat="server">
<ContentTemplate>
    <asp:TabContainer ID="MyTabContainer" runat="server">
        <asp:TabPanel ID="TabPanel1" runat="server" HeaderText="Thông tin chung">
        <ContentTemplate>
          <p class="clsnotices">Thông tin bắt buộc<span class="requitevalue">(*)</span></p>  	   
          <table cellspacing="1" class="classtable">  
                <%--<tr>
                    <td class="classcolleft">
                        Mã sản phẩm:</td>
                    <td class="classcolright">
                        <asp:TextBox ID="txtProductID" runat="server" Width="150px"></asp:TextBox>
                        <span class="requitevalue">(*)-Mã sản phẩm >=3 kí tự.</span>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidatorProductID" runat="server" 
                            ControlToValidate="txtProductID" ErrorMessage="Chưa nhập mã sản phẩm"></asp:RequiredFieldValidator>
                    </td>
                </tr>--%>
                <tr>
                    <td class="classcolleft">
                        Thuộc nhóm sản phẩm:</td>
                    <td class="classcolright">
                        <asp:DropDownList ID="DropdownParentID" runat="server" Width="250px" AppendDataBoundItems="true">
                            <asp:ListItem Value="0">---Chọn nhóm sản phẩm---</asp:ListItem>
                        </asp:DropDownList><span class="requitevalue">(*)</span>
                    </td>
                </tr>            
                <tr>
                    <td class="classcolleft">
                        Tên sản phẩm:</td>
                    <td class="classcolright">
                        <asp:TextBox ID="txtProductName" runat="server" Width="300px"></asp:TextBox><span class="requitevalue">(*)</span>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidatorTitle" runat="server" 
                            ControlToValidate="txtProductName" ErrorMessage="Chưa nhập tên sản phẩm"></asp:RequiredFieldValidator>
                    </td>
                </tr>   
                <tr>
                    <td class="classcolleft">
                    Mô tả:</td>
                    <td class="classcolright">
                        <asp:TextBox ID="txtDescription" runat="server" Height="60px" 
                            TextMode="MultiLine" Width="600px"></asp:TextBox>
                    </td>
                </tr>   
                <tr>
                <td class="classcolleft">
                        Nội dung:</td>
                    <td class="classcolright">
                        <CKEditor:CKEditorControl ID="CKEditorBody" runat="server" Toolbar="Full" Height="220px"></CKEditor:CKEditorControl>
                        </td>
                </tr>   
                <tr>
                    <td class="classcolleft">
                        Hiển thị:</td>
                    <td class="classcolright">
                        <asp:RadioButtonList ID="rdActive" runat="server" 
                            RepeatDirection="Horizontal">
                            <asp:ListItem Selected="True" Value="1">Có</asp:ListItem>
                            <asp:ListItem Value="0">Không</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>            
            </table>  
        </ContentTemplate>
        </asp:TabPanel>  
        <asp:TabPanel ID="TabPanel2" runat="server" HeaderText="Thông tin liên quan">
        <ContentTemplate>
            <p class="clsnotices">Thông tin bắt buộc<span class="requitevalue">(*)</span></p>   
        <table cellspacing="1" class="classtable">             
            <%--<tr>
                <td class="classcolleft">
                    Nhà sản xuất:</td>
                <td class="classcolright">
                    <asp:DropDownList ID="DropDownBrands" runat="server" Width="250px" AppendDataBoundItems="true">
                        <asp:ListItem Value="0">---Không chọn---</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr> --%>
            <tr>
                <td class="classcolleft">
                    Ảnh đại diện:</td>
                <td class="classcolright">
                    <asp:FileUpload ID="FileUploadImageDaiDien" runat="server" Width="300px" />
                </td>
            </tr>      
            <tr>
                <td class="classcolleft">
                Giá mới:
                </td>
                <td class="classcolright">   
                    <asp:TextBox ID="txtNewPrice" runat="server"  CssClass="clsprice"></asp:TextBox><span class="clsunitprice">vnđ</span>     
                    <asp:RangeValidator ID="RangeValidator1" runat="server" 
                ControlToValidate="txtNewPrice" ErrorMessage="(0-&gt;999999999)" 
                MaximumValue="999999999" MinimumValue="0" Type="Integer"></asp:RangeValidator>         
                </td>
            </tr>
            <tr>
                <td class="classcolleft">
                Giá cũ:
                </td>
                <td class="classcolright">   
                    <asp:TextBox ID="txtOldPrice" runat="server"  CssClass="clsprice"></asp:TextBox><span class="clsunitprice">vnđ</span>                
                    <asp:RangeValidator ID="RangeValidator2" runat="server" 
                        ControlToValidate="txtOldPrice" ErrorMessage="(0-&gt;999999999)" 
                        MaximumValue="999999999" MinimumValue="0" Type="Integer"></asp:RangeValidator>
                </td>
            </tr>
            <tr>
                <td class="classcolleft">                
                </td>
                <td class="classcolright">   
                <asp:CheckBox ID="chkSPNew" runat="server" Text="New" />
                 <asp:CheckBox ID="chkSPBanChay" runat="server" Text="Hot" />                 
                 <asp:CheckBox ID="chkSPKhuyenMai" runat="server" onclick="javascript:checkUncheckSPKhuyenMai();" Text="Sale" />
                 <asp:CheckBox ID="chkStatus" runat="server" Text="In stocking" Checked="true" />
                </td>
            </tr> 
            <%--<tr>
                <td class="classcolleft">
                Thông tin bảo hành:
                </td>
                <td class="classcolright">   
                    <asp:TextBox ID="txtBaoHanh" runat="server" TextMode="MultiLine" Width="600px"></asp:TextBox>
                </td>
            </tr>--%>
            <tr>
                <td class="classcolleft">
                 Thông tin khuyến mại:
                </td>
                <td class="classcolright">
                    <asp:TextBox ID="txtKhuyenMaiInfo" runat="server" Height="60px" 
                        TextMode="MultiLine" Width="600px"></asp:TextBox>
                </td>
            </tr>    
            <tr>
                <td class="classcolleft">                 
                </td>
                <td class="classcolright"> 
                <span class="requitevalue">Cho phép upload <=10 ảnh. Chấp nhận các định dạng: gif|jpg|png|bmp</span>                   
                </td>
            </tr>          
            <tr>
                <td class="classcolleft">
                Ảnh liên quan:
                   </td>
                <td class="classcolright">
                <div>
                    <asp:FileUpload ID="FileUploadImageRelated" runat="server" CssClass="multi" 
                        Width="300px" maxlength="10" accept="gif|jpg|png|bmp" />
                </div>            
                </td>
            </tr>                   
        </table> 
        </ContentTemplate>
    </asp:TabPanel>
    </asp:TabContainer>
    <table cellspacing="1" class="classtable">  
     <tr>
        <td class="classcolleft">
            &nbsp;</td>
        <td class="classcolright">
            <asp:LinkButton ID="lbtAddNewItem" runat="server" onclick="lbtAddNewItem_Click">
            <img src="../images/icons/icon_add.gif" border="0px" /> <b>Thêm Mới</b>
            </asp:LinkButton>
            ||
            <asp:LinkButton ID="lbtCloseForm" runat="server" 
                OnClientClick="javascript:CloseWindows();" CausesValidation="False">
            <img src="../images/icons/icon_close.jpg" border="0px" /><b>Đóng Lại</b>
            </asp:LinkButton>
            </td>
    </tr>
    </table> 
</ContentTemplate>
    <Triggers>
        <asp:PostBackTrigger ControlID="lbtAddNewItem" />
    </Triggers>
</asp:UpdatePanel>

